<?php
$v_record_id = 0;
if(isset($_REQUEST['hdn_record_id'])){
	$v_record_id = intval($_REQUEST['hdn_record_id']);
}
if (0>1){
if(!_check_permission_on_function($_SESSION['staff_id'], $_ISA_APP_CODE, _CONST_ONEGATE_AF_DELETE)){?>
	<script>
		alert("<? echo _CONST_FUNCTION_PERMISSION_ERROR; ?>");
		if (_MODAL_DIALOG_MODE==1){
			window.location = "<? echo $v_url; ?>";
		}else{
			window.history.back();
		}	
	</script><?
	exit;
}
}

$v_list_record_doc_id = 0;
if(isset($_REQUEST['hdn_record_doc_id_list'])){
	$v_list_record_doc_id = $_REQUEST['hdn_record_doc_id_list'];
	
}
$v_arrs_id_record=explode(',',$v_list_record_doc_id);
$v_sizeOfRecord=sizeof($v_arrs_id_record);
//echo $v_list_record_doc_id.'<br/>'.$v_sizeOfRecord.'<br/>';
//var_dump($v_arrs_id_record);exit;
if(_is_sqlserver()){
	
	for($i=0;$i<$v_sizeOfRecord;$i++){
		$cmd = mssql_init("Onegate_RecordDocDelete_DISPUTE",$conn); 
		$v_record_id_num_i=$v_arrs_id_record[$i];
		mssql_bind($cmd, "@p_record_doc_id_list", $v_record_id_num_i, SQLVARCHAR);    
		$result = mssql_execute($cmd); 
		$rs = @mssql_fetch_array($result);
		$aa++;
	}
	$v_error = _replace_bad_char(trim($rs['RET_ERROR']));
}

if (!is_null($v_error) and $v_error<>""){?>
	<script>
		alert("<? echo $v_error; ?>");
		window.history.back();
	</script><?php
	exit;
}?>
<form action="index.php"  Name="f_back" method="post">
	<input type="hidden" name="fuseaction" value="DISPLAY_ALL_RECORD_FOR_DISPUTE">	
	<input type="hidden" name="hdn_record_id"  value="<?php echo $v_record_id; ?>">
</form>		
<Script language="javascript">	
	document.forms(0).submit();
</Script> 


